﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MINERP.DigitalOutput
{
    public partial class FrmSetHWModel : Form
    {
        public FrmSetHWModel()
        {
            InitializeComponent();
        }
        public FrmDigitalMain2 dm { get; set; }
        public string PhotoCode { get; set; }           //照片编码
        private bool IsSet=false;                     //是否按了按钮

        private void FrmSetHWModel_Load(object sender, EventArgs e)
        {
            lblPhotoCode.Text = "照片:"+PhotoCode;
        }

        private void btnPhotoDPI_Click(object sender, EventArgs e)
        {
            IsSet = true;
            dm.CanContinue = true;
            dm.DistributeMode = false;  //按照片本身DPI分配
            this.Close();
        }

        private void btnPrinterDPI_Click(object sender, EventArgs e)
        {
            IsSet = true;
            dm.CanContinue = true;
            dm.DistributeMode = true;   //按打印机DPI分配
            this.Close();
        }

        private void btnNoDis_Click(object sender, EventArgs e)
        {
            IsSet = true;
            dm.CanContinue = false;
            dm.IsLX = true;
            this.Close();
        }

        private void FrmSetHWModel_FormClosing(object sender, FormClosingEventArgs e)
        {
            if(IsSet==false)
                dm.CanContinue = false;
        }

        //是否连续分配
        private void cbTX_CheckedChanged(object sender, EventArgs e)
        {
            if (cbTX.Checked)
            {
                dm.IsLX = true;
            }
            else
            {
                dm.IsLX = false;
            }
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (radioButtonPhoto.Checked)
            {
                IsSet = true;
                dm.CanContinue = true;
                dm.DistributeMode = false;  //按照片本身DPI分配
            }
            else
            {
                IsSet = true;
                dm.CanContinue = true;
                dm.DistributeMode = true;   //按打印机DPI分配
            }
            this.Close();
        }
    }
}
